package com.zb.feigns;

import com.zb.config.HeimaFeignAutoConfiguration;
import com.zb.feigns.fallback.WemediaFeignFallback;
import com.zb.model.common.Result;
import com.zb.model.pojo.wemedia.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(
        value = "wemedia-service",
        fallbackFactory = WemediaFeignFallback.class,
        configuration = HeimaFeignAutoConfiguration.class
)
public interface WemediaFeign {
    @PostMapping("/api/v1/media/save")
    Result<Integer> save(@RequestBody WmUser wmUser);
    @GetMapping("/api/v1/media/findByName/{name}")
    Result<WmUser> findByName(@PathVariable("name") String name);
}
